/**
 * 
 */
package de.fhbrs.litsearch;

import de.fhbrs.ConfigReader.ConfigReader;

/**
 * @author Stephan Schmitt, Andreas Moser
 *
 */
public class Datastream  {	
	
	//Pfad mit Dateinamen
	private String path;
	//Selbstvergebener Name
	private String name;
	private String MimeType;
	//URL aus Fedora
	private String url;
	//id zum Arktikel
	private String pid;
	//id vom Artikel in der SQL-DB
	private String temp_id;
	
	public Datastream(){}
	
	public Datastream(String path, String name, String mimeType, String temp_id) 
	{
		this.path = path;
		this.name = name;
		this.MimeType = mimeType;
		this.temp_id = temp_id;
	}

	public String getPath() {
		return path;
	}
	
	public void setPath(String path) {
		this.path = path;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getMimeType() {
		return MimeType;
	}
	
	public void setMimeType(String mimeType) {
		MimeType = mimeType;
	}
	
	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public void setUrl(){
		String localhost = ConfigReader.getInstance().readKey("litsearch.global.fedora.host");
		String port = ConfigReader.getInstance().readKey("litsearch.global.fedora.port");
		this.url = "http://"+localhost+":"+port+"/fedora/get/"+this.pid+"/"+this.name;
	}
	
	public String getUrl(){
		return url;
	}

	public String getTemp_id() {
		return temp_id;
	}

	public void setTemp_id(String temp_id) {
		this.temp_id = temp_id;
	}
}
